package com.lqq.designPattern.behavioral_pattern.observer;

//测试类
public class Client {
    public static void main(String[] args) {
        //新增公众号对象
        Subject subject = new SubscriptionSubject();
        //创建微信用户，并关注公众号
        subject.attach(new WeiXinUser("张无忌"));
        subject.attach(new WeiXinUser("赵敏"));
        subject.attach(new WeiXinUser("周芷若"));
        //公众号更新消息
        String msg = "观察者模式";
        System.out.println("七七学Java公众号推送了推文：" + msg);
        subject.notify(msg);
    }
}
